package com.hs.sfzy.controller;

import com.hs.sfzy.entity.MyConsult;
import com.hs.sfzy.service.MyConsultService;
import com.hs.sfzy.until.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName MyConsultController
 * @Description TODO
 * @Author liuzhuo
 * @Date 2025年08月13日 11:13
 * @Version 1.0
 */
@RestController
@RequestMapping("MyConsult")
public class MyConsultController {
    @Autowired
    private MyConsultService myConsultService;

    @PostMapping
    public R insertMyConsult(@RequestBody MyConsult myConsult) {
        int insert = myConsultService.insert(myConsult);
        return R.ok(insert);
    }

    @PutMapping
    public R updateMyConsult(@RequestBody MyConsult myConsult) {

        int update = myConsultService.update(myConsult);
        if (update > 1) {
            return R.ok();
        }
        return R.fail();
    }

}
